package wmi

import "time"

// Win32_Process 进程
//
// instance of Win32_Process
//
//	{
//		Caption = "svchost.exe";
//		CreationClassName = "Win32_Process";
//		CreationDate = "20230920174346.827404+480";
//		CSCreationClassName = "Win32_ComputerSystem";
//		CSName = "DESKTOP-NLGJU3L";
//		Description = "svchost.exe";
//		Handle = "3832";
//		HandleCount = 231;
//		KernelModeTime = "2187500";
//		Name = "svchost.exe";
//		OSCreationClassName = "Win32_OperatingSystem";
//		OSName = "Microsoft Windows 11 企业版|C:\\WINDOWS|\\Device\\Harddisk1\\Partition3";
//		OtherOperationCount = "3078";
//		OtherTransferCount = "1023302";
//		PageFaults = 5599;
//		PageFileUsage = 2428;
//		ParentProcessId = 792;
//		PeakPageFileUsage = 2996;
//		PeakVirtualSize = "2203414925312";
//		PeakWorkingSetSize = 11868;
//		Priority = 8;
//		PrivatePageCount = "2486272";
//		ProcessId = 3832;
//		QuotaNonPagedPoolUsage = 16;
//		QuotaPagedPoolUsage = 98;
//		QuotaPeakNonPagedPoolUsage = 93;
//		QuotaPeakPagedPoolUsage = 116;
//		ReadOperationCount = "0";
//		ReadTransferCount = "0";
//		SessionId = 0;
//		ThreadCount = 2;
//		UserModeTime = "1250000";
//		VirtualSize = "2203405045760";
//		WindowsVersion = "10.0.22621";
//		WorkingSetSize = "10547200";
//		WriteOperationCount = "0";
//		WriteTransferCount = "0";
//	};
type Win32_Process struct {
	CSCreationClassName        string
	CSName                     string
	Caption                    *string
	CommandLine                *string
	CreationClassName          string
	CreationDate               *time.Time
	Description                *string
	ExecutablePath             *string
	ExecutionState             *uint16
	Handle                     string
	HandleCount                uint32
	InstallDate                *time.Time
	KernelModeTime             uint64
	MaximumWorkingSetSize      *uint32
	MinimumWorkingSetSize      *uint32
	Name                       string
	OSCreationClassName        string
	OSName                     string
	OtherOperationCount        uint64
	OtherTransferCount         uint64
	PageFaults                 uint32
	PageFileUsage              uint32
	ParentProcessId            uint32
	PeakPageFileUsage          uint32
	PeakVirtualSize            uint64
	PeakWorkingSetSize         uint32
	Priority                   uint32
	PrivatePageCount           uint64
	ProcessId                  uint32
	QuotaNonPagedPoolUsage     uint32
	QuotaPagedPoolUsage        uint32
	QuotaPeakNonPagedPoolUsage uint32
	QuotaPeakPagedPoolUsage    uint32
	ReadOperationCount         uint64
	ReadTransferCount          uint64
	SessionId                  uint32
	Status                     *string
	TerminationDate            *time.Time
	ThreadCount                uint32
	UserModeTime               uint64
	VirtualSize                uint64
	WindowsVersion             string
	WorkingSetSize             uint64
	WriteOperationCount        uint64
	WriteTransferCount         uint64
}

// Win32_PhysicalMemory 内存
//
// instance of Win32_PhysicalMemory
//
//	{
//		Attributes = 2;
//		BankLabel = "";
//		Capacity = "17179869184";
//		Caption = "物理内存";
//		ConfiguredClockSpeed = 2400;
//		ConfiguredVoltage = 1200;
//		CreationClassName = "Win32_PhysicalMemory";
//		DataWidth = 64;
//		Description = "物理内存";
//		DeviceLocator = "DIMM1";
//		FormFactor = 8;
//		InterleaveDataDepth = 1;
//		InterleavePosition = 1;
//		Manufacturer = "0198000080CE";
//		MaxVoltage = 0;
//		MemoryType = 0;
//		MinVoltage = 0;
//		Name = "物理内存";
//		PartNumber = "KF3200C16D4/16GX    ";
//		PositionInRow = 1;
//		SerialNumber = "82704EE7";
//		SMBIOSMemoryType = 26;
//		Speed = 2400;
//		Tag = "Physical Memory 0";
//		TotalWidth = 64;
//		TypeDetail = 128;
//	};
type Win32_PhysicalMemory struct {
	Attributes           int
	BankLabel            string
	Capacity             int // "17179869184";
	Caption              string
	ConfiguredClockSpeed int
	ConfiguredVoltage    int
	CreationClassName    string
	DataWidth            int
	Description          string
	DeviceLocator        string
	FormFactor           int
	InterleaveDataDepth  int
	InterleavePosition   int
	Manufacturer         string
	MaxVoltage           int
	MemoryType           int
	MinVoltage           int
	Name                 string
	PartNumber           string
	PositionInRow        int
	SerialNumber         string
	SMBIOSMemoryType     int
	Speed                int
	Tag                  string
	TotalWidth           int
	TypeDetail           int
}

// Win32_Processor 处理器
//
// instance of Win32_Processor
//
//	{
//		AddressWidth = 64;
//		Architecture = 9;
//		AssetTag = "";
//		Availability = 3;
//		Caption = "Intel64 Family 6 Model 165 Stepping 3";
//		Characteristics = 252;
//		CpuStatus = 1;
//		CreationClassName = "Win32_Processor";
//		CurrentClockSpeed = 3601;
//		CurrentVoltage = 9;
//		DataWidth = 64;
//		Description = "Intel64 Family 6 Model 165 Stepping 3";
//		DeviceID = "CPU0";
//		ExtClock = 100;
//		Family = 206;
//		L2CacheSize = 1024;
//		L3CacheSize = 6144;
//		L3CacheSpeed = 0;
//		Level = 6;
//		LoadPercentage = 1;
//		Manufacturer = "GenuineIntel";
//		MaxClockSpeed = 3601;
//		Name = "Intel(R) Core(TM) i3-10100 CPU @ 3.60GHz";
//		NumberOfCores = 4;
//		NumberOfEnabledCore = 4;
//		NumberOfLogicalProcessors = 8;
//		PartNumber = "";
//		PowerManagementSupported = FALSE;
//		ProcessorId = "BFEBFBFF000A0653";
//		ProcessorType = 3;
//		Role = "CPU";
//		SecondLevelAddressTranslationExtensions = FALSE;
//		SerialNumber = "";
//		SocketDesignation = "U3E1";
//		Status = "OK";
//		StatusInfo = 3;
//		SystemCreationClassName = "Win32_ComputerSystem";
//		SystemName = "DESKTOP-NLGJU3L";
//		ThreadCount = 8;
//		UpgradeMethod = 1;
//		Version = "";
//		VirtualizationFirmwareEnabled = FALSE;
//		VMMonitorModeExtensions = FALSE;
//	};
type Win32_Processor struct {
	AddressWidth                            int
	Architecture                            int
	AssetTag                                string
	Availability                            int
	Caption                                 string
	Characteristics                         int
	CpuStatus                               int
	CreationClassName                       string
	CurrentClockSpeed                       int
	CurrentVoltage                          int
	DataWidth                               int
	Description                             string
	DeviceID                                string
	ExtClock                                int
	Family                                  int
	L2CacheSize                             int
	L3CacheSize                             int
	L3CacheSpeed                            int
	Level                                   int
	LoadPercentage                          int
	Manufacturer                            string
	MaxClockSpeed                           int
	Name                                    string
	NumberOfCores                           int
	NumberOfEnabledCore                     int
	NumberOfLogicalProcessors               int
	PartNumber                              string
	PowerManagementSupported                bool
	ProcessorId                             string
	ProcessorType                           int
	Role                                    string
	SecondLevelAddressTranslationExtensions bool
	SerialNumber                            string
	SocketDesignation                       string
	Status                                  string
	StatusInfo                              int
	SystemCreationClassName                 string
	SystemName                              string
	ThreadCount                             int
	UpgradeMethod                           int
	Version                                 string
	VirtualizationFirmwareEnabled           bool
	VMMonitorModeExtensions                 bool
}

// Win32_DiskDrive 硬盘驱动器
//
// instance of Win32_DiskDrive
//
//	{
//		BytesPerSector = 512;
//		Capabilities = {3, 4};
//		CapabilityDescriptions = {"Random Access", "Supports Writing"};
//		Caption = "PM991 NVMe Samsung 256GB";
//		ConfigManagerErrorCode = 0;
//		ConfigManagerUserConfig = FALSE;
//		CreationClassName = "Win32_DiskDrive";
//		Description = "磁盘驱动器";
//		DeviceID = "\\\\.\\PHYSICALDRIVE1";
//		FirmwareRevision = "25307039";
//		Index = 1;
//		InterfaceType = "SCSI";
//		Manufacturer = "(标准磁盘驱动器)";
//		MediaLoaded = TRUE;
//		MediaType = "Fixed hard disk media";
//		Model = "PM991 NVMe Samsung 256GB";
//		Name = "\\\\.\\PHYSICALDRIVE1";
//		Partitions = 5;
//		PNPDeviceID = "SCSI\\DISK&VEN_NVME&PROD_PM991_NVME_SAMSU\\4&C07F77&0&020000";
//		SCSIBus = 2;
//		SCSILogicalUnit = 0;
//		SCSIPort = 0;
//		SCSITargetId = 0;
//		SectorsPerTrack = 63;
//		SerialNumber = "3530_4130_4E96_0401_0025_3846_0000_0001.";
//		Size = "256052966400";
//		Status = "OK";
//		SystemCreationClassName = "Win32_ComputerSystem";
//		SystemName = "DESKTOP-NLGJU3L";
//		TotalCylinders = "31130";
//		TotalHeads = 255;
//		TotalSectors = "500103450";
//		TotalTracks = "7938150";
//		TracksPerCylinder = 255;
//	};
type Win32_DiskDrive struct {
	BytesPerSector          int
	Capabilities            []int
	CapabilityDescriptions  []string
	Caption                 string
	ConfigManagerErrorCode  int
	ConfigManagerUserConfig bool
	CreationClassName       string
	Description             string
	DeviceID                string
	FirmwareRevision        string
	Index                   int
	InterfaceType           string
	Manufacturer            string
	MediaLoaded             bool
	MediaType               string
	Model                   string
	Name                    string
	Partitions              int
	PNPDeviceID             string
	SCSIBus                 int
	SCSILogicalUnit         int
	SCSIPort                int
	SCSITargetId            int
	SectorsPerTrack         int
	SerialNumber            string
	Size                    int
	Status                  string
	SystemCreationClassName string
	SystemName              string
	TotalCylinders          int
	TotalHeads              int
	TotalSectors            int
	TotalTracks             int
	TracksPerCylinder       int
}

// Win32_LogicalDisk 逻辑磁盘
//
// instance of Win32_LogicalDisk
//
//	{
//		Access = 0;
//		Caption = "C:";
//		Compressed = FALSE;
//		CreationClassName = "Win32_LogicalDisk";
//		Description = "本地固定磁盘";
//		DeviceID = "C:";
//		DriveType = 3;
//		FileSystem = "NTFS";
//		FreeSpace = "44873621504";
//		MaximumComponentLength = 255;
//		MediaType = 12;
//		Name = "C:";
//		Size = "238467149824";
//		SupportsDiskQuotas = FALSE;
//		SupportsFileBasedCompression = TRUE;
//		SystemCreationClassName = "Win32_ComputerSystem";
//		SystemName = "DESKTOP-NLGJU3L";
//		VolumeName = "OS";
//		VolumeSerialNumber = "526C7090";
//	};
type Win32_LogicalDisk struct {
	Access                       int
	Caption                      string
	Compressed                   bool
	CreationClassName            string
	Description                  string
	DeviceID                     string
	DriveType                    int
	FileSystem                   string
	FreeSpace                    int
	MaximumComponentLength       int
	MediaType                    int
	Name                         string
	Size                         int
	SupportsDiskQuotas           bool
	SupportsFileBasedCompression bool
	SystemCreationClassName      string
	SystemName                   string
	VolumeName                   string
	VolumeSerialNumber           string
}

// Win32_DiskPartition
//
// instance of Win32_DiskPartition
//
//	{
//		BlockSize = "512";
//		Bootable = TRUE;
//		BootPartition = TRUE;
//		Caption = "磁盘 #1，分区 #0";
//		CreationClassName = "Win32_DiskPartition";
//		Description = "GPT: 系统";
//		DeviceID = "Disk #1, Partition #0";
//		DiskIndex = 1;
//		Index = 0;
//		Name = "磁盘 #1，分区 #0";
//		NumberOfBlocks = "307200";
//		PrimaryPartition = TRUE;
//		Size = "157286400";
//		StartingOffset = "1048576";
//		SystemCreationClassName = "Win32_ComputerSystem";
//		SystemName = "DESKTOP-NLGJU3L";
//		Type = "GPT: System";
//	};
type Win32_DiskPartition struct {
	BlockSize               int
	Bootable                bool
	BootPartition           bool
	Caption                 string
	CreationClassName       string
	Description             string
	DeviceID                string
	DiskIndex               int
	Index                   int
	Name                    string
	NumberOfBlocks          int
	PrimaryPartition        bool
	Size                    int
	StartingOffset          int
	SystemCreationClassName string
	SystemName              string
	Type                    string
}

type LogicalDisk struct {
	Win32_LogicalDisk
	DiskDrive *Win32_DiskDrive
}

// Win32_OperatingSystem
//
// instance of Win32_OperatingSystem
//
//	{
//		BootDevice = "\\Device\\HarddiskVolume5";
//		BuildNumber = "22621";
//		BuildType = "Multiprocessor Free";
//		Caption = "Microsoft Windows 11 企业版";
//		CodeSet = "936";
//		CountryCode = "86";
//		CreationClassName = "Win32_OperatingSystem";
//		CSCreationClassName = "Win32_ComputerSystem";
//		CSName = "DESKTOP-NLGJU3L";
//		CurrentTimeZone = 480;
//		DataExecutionPrevention_32BitApplications = TRUE;
//		DataExecutionPrevention_Available = TRUE;
//		DataExecutionPrevention_Drivers = TRUE;
//		DataExecutionPrevention_SupportPolicy = 2;
//		Debug = FALSE;
//		Description = "";
//		Distributed = FALSE;
//		EncryptionLevel = 256;
//		ForegroundApplicationBoost = 2;
//		FreePhysicalMemory = "17900240";
//		FreeSpaceInPagingFiles = "4747852";
//		FreeVirtualMemory = "19547968";
//		InstallDate = "20221108162949.000000+480";
//		LastBootUpTime = "20230920174331.500000+480";
//		LocalDateTime = "20230922182207.203000+480";
//		Locale = "0804";
//		Manufacturer = "Microsoft Corporation";
//		MaxNumberOfProcesses = 4294967295;
//		MaxProcessMemorySize = "137438953344";
//		MUILanguages = {"zh-CN", "en-US"};
//		Name = "Microsoft Windows 11 企业版|C:\\WINDOWS|\\Device\\Harddisk1\\Partition3";
//		NumberOfLicensedUsers = 0;
//		NumberOfProcesses = 282;
//		NumberOfUsers = 2;
//		OperatingSystemSKU = 4;
//		OSArchitecture = "64 位";
//		OSLanguage = 2052;
//		OSProductSuite = 256;
//		OSType = 18;
//		PortableOperatingSystem = FALSE;
//		Primary = TRUE;
//		ProductType = 1;
//		RegisteredUser = "tony";
//		SerialNumber = "00329-00000-00003-AA149";
//		ServicePackMajorVersion = 0;
//		ServicePackMinorVersion = 0;
//		SizeStoredInPagingFiles = "4980736";
//		Status = "OK";
//		SuiteMask = 272;
//		SystemDevice = "\\Device\\HarddiskVolume7";
//		SystemDirectory = "C:\\WINDOWS\\system32";
//		SystemDrive = "C:";
//		TotalVirtualMemorySize = "38275468";
//		TotalVisibleMemorySize = "33294732";
//		Version = "10.0.22621";
//		WindowsDirectory = "C:\\WINDOWS";
//	};
type Win32_OperatingSystem struct {
	BootDevice                                string
	BuildNumber                               string
	BuildType                                 string
	Caption                                   string
	CodeSet                                   int
	CountryCode                               int
	CreationClassName                         string
	CSCreationClassName                       string
	CSName                                    string
	CurrentTimeZone                           int
	DataExecutionPrevention_32BitApplications bool
	DataExecutionPrevention_Available         bool
	DataExecutionPrevention_Drivers           bool
	DataExecutionPrevention_SupportPolicy     int
	Debug                                     bool
	Description                               string
	Distributed                               bool
	EncryptionLevel                           int
	ForegroundApplicationBoost                int
	FreePhysicalMemory                        int
	FreeSpaceInPagingFiles                    int
	FreeVirtualMemory                         int
	InstallDate                               *time.Time
	LastBootUpTime                            *time.Time
	LocalDateTime                             *time.Time
	Locale                                    string
	Manufacturer                              string
	MaxNumberOfProcesses                      int
	MaxProcessMemorySize                      int
	MUILanguages                              []string
	Name                                      string
	NumberOfLicensedUsers                     int
	NumberOfProcesses                         int
	NumberOfUsers                             int
	OperatingSystemSKU                        int
	OSArchitecture                            string
	OSLanguage                                int
	OSProductSuite                            int
	OSType                                    int
	PortableOperatingSystem                   bool
	Primary                                   bool
	ProductType                               int
	RegisteredUser                            string
	SerialNumber                              string
	ServicePackMajorVersion                   int
	ServicePackMinorVersion                   int
	SizeStoredInPagingFiles                   int
	Status                                    string
	SuiteMask                                 int
	SystemDevice                              string
	SystemDirectory                           string
	SystemDrive                               string
	TotalVirtualMemorySize                    int
	TotalVisibleMemorySize                    int
	Version                                   string
	WindowsDirectory                          string
}
